<?php

//顶部菜单 widget
HTML::macro('topmenu', function() {
    $menu = new Kj\Admin\Html\Menu();
    return $menu->topMenu();
});

//顶部二级菜单 widget
HTML::macro('submenu', function() {
    $menu = new Kj\Admin\Html\Menu();
    return $menu->subMenu();
});

//底部的面包屑 widget
HTML::macro('footerCrumbs', function() {
    $menu = new Kj\Admin\Html\Menu();
    return $menu->footerCrumbs();
});

//顶部二级菜单右边的按钮 widget
HTML::macro('submr', function() {
    $menu = new Kj\Admin\Html\Menu();
    return $menu->subMenuAction();
});

//树形结构所需js.css
HTML::macro('treeviewResources', function() {
    $menu = new Kj\Admin\Html\Common();
    return $menu->treeviewResources();
});

//上传组件
HTML::macro('swfUploadButton', function($id, $submit_images = 'submit_images', $alowexts = '', $nums = 8, $thumb_setting = array(), $watermark_setting = 0) {
    $menu = new Kj\Admin\Html\Common();
    return $menu->swfUploadButton($id, $submit_images, $alowexts, $nums, $thumb_setting, $watermark_setting);
});

//用户管理列表中的增加按钮
HTML::macro('userAdd', function($class, $function) {
    $obj = new Kj\Admin\Html\UserList();
    return $obj->add(false, $class, $function);
});

//用户管理列表中的编辑按钮
HTML::macro('userEdit', function($class, $function, $data) {
    $obj = new Kj\Admin\Html\UserList();
    return $obj->edit(false, $class, $function, $data);
});

//用户管理列表中的权限编辑按钮
HTML::macro('userAcl', function($class, $function, $data) {
    $obj = new Kj\Admin\Html\UserList();
    return $obj->acl(false, $class, $function, $data);
});

//用户管理列表中的删除按钮
HTML::macro('userDelete', function($class, $function, $data) {
    $obj = new Kj\Admin\Html\UserList();
    return $obj->delete(false, $class, $function, $data);
});

//用户管理列表中的权限编辑按钮
HTML::macro('userDeleteAll', function($class, $function, $data) {
    $obj = new Kj\Admin\Html\UserList();
    return $obj->deleteAll(false, $class, $function, $data);
});

//用户组管理列表中的增加按钮
HTML::macro('groupAdd', function($class, $function) {
    $obj = new Kj\Admin\Html\GroupList();
    return $obj->add(false, $class, $function);
});

//用户组管理列表中的编辑按钮
HTML::macro('groupEdit', function($class, $function, $data) {
    $obj = new Kj\Admin\Html\GroupList();
    return $obj->edit(false, $class, $function, $data);
});

//用户组管理列表中的权限编辑按钮
HTML::macro('groupAcl', function($class, $function, $data) {
    $obj = new Kj\Admin\Html\GroupList();
    return $obj->acl(false, $class, $function, $data);
});

//用户组管理列表中的删除按钮
HTML::macro('groupDelete', function($class, $function, $data) {
    $obj = new Kj\Admin\Html\GroupList();
    return $obj->delete(false, $class, $function, $data);
});

//用户组管理列表中的批量删除按钮
HTML::macro('groupDeleteAll', function($class, $function, $data) {
    $obj = new Kj\Admin\Html\GroupList();
    return $obj->deleteAll(false, $class, $function, $data);
});

//功能权限管理列表中的增加按钮
HTML::macro('aclAdd', function($class, $function) {
    $obj = new Kj\Admin\Html\AclList();
    return $obj->add(false, $class, $function);
});

//功能权限管理列表中的编辑按钮
HTML::macro('aclEdit', function($class, $function, $data) {
    $obj = new Kj\Admin\Html\AclList();
    return $obj->edit(false, $class, $function, $data);
});

//功能权限管理列表中的删除按钮
HTML::macro('aclDelete', function($class, $function, $data) {
    $obj = new Kj\Admin\Html\AclList();
    return $obj->delete(false, $class, $function, $data);
});

//功能权限管理列表中的批量删除按钮
HTML::macro('aclDeleteAll', function($class, $function) {
    $obj = new Kj\Admin\Html\AclList();
    return $obj->deleteAll(false, $class, $function);
});

//功能权限管理列表中的排序按钮
HTML::macro('aclSort', function($class, $function) {
    $obj = new Kj\Admin\Html\AclList();
    return $obj->sortList(false, $class, $function);
});

//顶部菜单 widget
HTML::macro('initupload', function($args, $upload_maxsize, $useridFlash = '0') {
    $obj = new Kj\Admin\Libraries\SwfUpload($args);
    $obj->setUploadMaxSize($upload_maxsize);
    return $obj->initupload($useridFlash);
});

//内容管理增加文章按钮 widget
HTML::macro('contentAdd', function($class, $function) {
    $obj = new Kj\Admin\Html\ContentList();
    return $obj->add(false, $class, $function);
});